<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>

<t:base type="jquery,easyui,tools,DatePicker,autocomplete"></t:base>

<script type="text/javascript" charset="utf-8">
	/*
	 *	excel导出
	 */
	function tasksListExportXlsByT() {
		JeecgExcelExport("tasksController.do?exportXlsByT&type=${type}","rateReportList_${type}");
	}

</script>
<div class="easyui-layout" fit="true">
  <div region="center" style="padding:1px;">
  <t:datagrid name="rateReportList_${type}" title="成材率报表" actionUrl="tasksController.do?rate_datagrid" queryParams="{type:'${type}'}"  idField="fid" fit="true" queryMode="group" pagination="true" autoLoadData="true">
   <t:dgCol title="编号" field="id" hidden="true"></t:dgCol>
   <t:dgCol title="fid" field="fid" hidden="true"></t:dgCol>
   <t:dgCol title="状态" field="fstate" dictionary="rwdstate"  style="setColor()"></t:dgCol>
   <t:dgCol title="本厂批号" field="fbcph" query="true" autocomplete="true"></t:dgCol>
   <t:dgCol title="物料名称" field="fwlname" query="true"></t:dgCol>
   <t:dgCol title="原料供货商" field="fylghs" ></t:dgCol>
   <t:dgCol title="原厂炉号" field="fyclh" ></t:dgCol>
   <t:dgCol title="规格型号" field="ftype" hidden="false"></t:dgCol>
   <t:dgCol title="厚度" field="fthick" ></t:dgCol>
   <t:dgCol title="宽度" field="fwidth" ></t:dgCol>
   <t:dgCol title="重量" field="fweight" ></t:dgCol>
   <t:dgCol title="生产车间" field="fworkshop" dictionary="workshop" hidden="false"></t:dgCol>
   <t:dgCol title="入库时间" field="instockDate" formatter="yyyy-MM-dd"  query="true" queryMode="group"></t:dgCol>
   <t:dgCol title="产出规格" field="fccgg" ></t:dgCol>
   <t:dgCol title="成品重量" field="fcpzl" ></t:dgCol>
   <t:dgCol title="成材率" field="frate"  ></t:dgCol>
   <t:dgCol title="制单人" field="createBy" ></t:dgCol>
   <t:dgCol title="制单日期" field="createDate"   formatter="yyyy-MM-dd" query="true" queryMode="group" ></t:dgCol>
   <t:dgToolBar title="查看" icon="icon-search" url="tasksController.do?addorupdate" funname="showProcesss"></t:dgToolBar>
   <t:dgToolBar title="导出Excel" icon="icon-search" onclick="tasksListExportXlsByT()"   operationCode="export"></t:dgToolBar>
  </t:datagrid>
  </div>
 </div>

  <script type="text/javascript" charset="utf-8">
  	function showProcesss(title,url, id,width,height) {
		var rowsData = $('#'+id).datagrid('getSelections');
		
		if (!rowsData || rowsData.length == 0) {
			tip('请选择查看项目');
			return;
		}
		if (rowsData.length > 1) {
			tip('请选择一条记录再查看');
			return;
		}
	    url += '&load=detail&id='+rowsData[0].fid+'&fbcph='+rowsData[0].fbcph;
		createdetailwindow(title,url,'100%','100%');
	}
  
  
 	function setColor(value,rec,index){
 		
 		
 			return "color:green;";
 	}
 	/*
 		function setColor2(value,rec,index){
 		
 		var value2 = parseFloat(value);
 		var value3 = parseFloat('${avg_frate}');
 		if(value2 >= value3){
 		return "color:green;";
 		}else{
 		return "color:red;";
 		}
 	}
 	*/
  	$(document).ready(function(){
 	  
		$("input[name='createDate_begin']").attr("class","easyui-datebox");
		$("input[name='createDate_end']").attr("class","easyui-datebox");
		
		$("input[name='instockDate_begin']").attr("class","easyui-datebox");
		$("input[name='instockDate_end']").attr("class","easyui-datebox");
       
	}); 
	
	
	
 </script>